package com.bgs.vo;

import com.bgs.pojo.Mine;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Auther: 梁玉杰
 * @Date: 2022/5/10 20:48
 * @Description: TODO
 */
@Data
public class MineVo extends Mine {

    private Integer limit;
    private Integer page;

    @ApiModelProperty(value = "开始时间")
    private String starTime;

    @ApiModelProperty(value = "结束时间")
    private String endTime;

    @ApiModelProperty(value = "开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//DateTimeFormat 是入参格式化；
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//JsonFormat是出参格式化。
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private Date starTimes;

    @ApiModelProperty(value = "结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//DateTimeFormat 是入参格式化；
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//JsonFormat是出参格式化。
    private Date endTimes;


    @ApiModelProperty(value = "名字")
    private String name;

    @ApiModelProperty(value = "图片的url")
    private String picture;

    @ApiModelProperty(value = "eid")
    private Integer eid;

    @Override
    public String toString() {
        return "MineVo{" +super.toString()+
                "starTime='" + starTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", starTimes=" + starTimes +
                ", endTimes=" + endTimes +
                ", name='" + name + '\'' +
                ", picture='" + picture + '\'' +
                '}';
    }
}
